package com.mathdroid.model.enums;

import java.util.LinkedList;

import com.mathdroid.modules.ISpecProficiencies;
import com.mathdroid.modules.sniper.SniperProficiencies;

/**
 * Each specialization gets an enumeration and name.
 */
public enum ESpec {
	
	//TODO for now all have the proficiencies of a sniper.
	/**
	 * Vanguard spec.
	 */
	VANGUARD("Vanguard", EClass.TROOPER, new SniperProficiencies()),
	/**
	 * Commando spec.
	 */
	COMMANDO("Commando", EClass.TROOPER, new SniperProficiencies()),
	/**
	 * Gunslinger spec.
	 */
	GUNSLINGER("Gunslinger", EClass.SMUGGLER, new SniperProficiencies()),
	/**
	 * Scoundrel spec.
	 */
	SCOUNDREL("Scoundrel", EClass.SMUGGLER, new SniperProficiencies()),
	/**
	 * Guardian spec.
	 */
	GUARDIAN("Guardian", EClass.JEDI_KNIGHT, new SniperProficiencies()),
	/**
	 * Sentinel spec.
	 */
	SENTINEL("Sentinel", EClass.JEDI_KNIGHT, new SniperProficiencies()),
	/**
	 * Sage spec.
	 */
	SAGE("Sage", EClass.JEDI_CONSULAR, new SniperProficiencies()),
	/**
	 * Shadow spec.
	 */
	SHADOW("Shadow", EClass.JEDI_CONSULAR, new SniperProficiencies()),
	
	/**
	 * Powertech spec.
	 */
	POWERTECH("Powertech", EClass.BOUNTY_HUNTER, new SniperProficiencies()),
	/**
	 * Mercenary spec.
	 */
	MERCENARY("Mercenary", EClass.BOUNTY_HUNTER, new SniperProficiencies()),
	/**
	 * Juggernaut spec.
	 */
	JUGGERNAUT("Juggernaut", EClass.SITH_WARRIOR, new SniperProficiencies()),
	/**
	 * Marauder spec.
	 */
	MARAUDER("Marauder", EClass.SITH_WARRIOR, new SniperProficiencies()),
	/**
	 * Operative spec.
	 */
	OPERATIVE("Operative", EClass.IMPERIAL_AGENT, new SniperProficiencies()),
	/**
	 * Sniper spec.
	 */
	SNIPER("Sniper", EClass.IMPERIAL_AGENT, new SniperProficiencies()),
	/**
	 * Sorcerer spec.
	 */
	SORCERER("Sorcerer", EClass.SITH_INQUISITOR, new SniperProficiencies()),
	/**
	 * Assassin spec.
	 */
	ASSASSIN("Assassin", EClass.SITH_INQUISITOR, new SniperProficiencies());
	
	/**
	 * String representation of this enum.
	 */
	private String name = null;
	
	/**
	 * The class the spec belongs to.
	 */
	private EClass eclass = null;
	
	/**
	 * The proficiencies of this spec.
	 */
	private ISpecProficiencies p = null;
	
	/**
	 * Create an spec enumeration.
	 * @param n Spec name.
	 * @param e The class of the spec.
	 * @param sps The proficiencies of this spec.
	 */
	private ESpec(
			final String n, final EClass e, final ISpecProficiencies sps) {
		this.name = n;
		this.eclass = e;
		this.p = sps;
	}
	
	/**
	 * Get a list of all specializations.
	 * @return List of all specs.
	 */
	public static LinkedList<ESpec> getAllSpecs() {
		LinkedList<ESpec> list = new LinkedList<ESpec>();
		
		list.add(ESpec.VANGUARD);
		list.add(ESpec.COMMANDO);
		list.add(ESpec.GUNSLINGER);
		list.add(ESpec.SCOUNDREL);
		list.add(ESpec.GUARDIAN);
		list.add(ESpec.SENTINEL);
		list.add(ESpec.SAGE);
		list.add(ESpec.SHADOW);
		list.add(ESpec.POWERTECH);
		list.add(ESpec.MERCENARY);
		list.add(ESpec.JUGGERNAUT);
		list.add(ESpec.MARAUDER);
		list.add(ESpec.OPERATIVE);
		list.add(ESpec.SNIPER);
		list.add(ESpec.SORCERER);
		list.add(ESpec.ASSASSIN);
		
		return list;
	}
	
	@Override	
	public String toString() {
		return this.name;
	}

	/**
	 * Get the character class of this specialization.
	 * @return Character class.
	 */
	public EClass getSpecClass() {
		return this.eclass;
	}

	/**
	 * Get the proficiencies of this specialization.
	 * @return Proficiencies.
	 */
	public ISpecProficiencies getProficiencies() {
		return this.p;
	}
	
	
}
